


//
//  UpdateImageSubCell.m
//  BusinessMarket
//
//  Created by Michael Li on 2018/11/1.
//  Copyright © 2018年 Michael Li. All rights reserved.
//

#import "UpdateImageSubCell.h"
#import "AuthenticationModel.h"
#import "UIButton+WebCache.h"
@interface UpdateImageSubCell()

@end
@implementation UpdateImageSubCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.clickFrontBtn.layer.cornerRadius = 3;
    self.clickFrontBtn.layer.borderColor  = kOrangeBg.CGColor;
    self.clickFrontBtn.layer.borderWidth  = 1;
    self.frontL.textColor = kLabel153Color;
}
- (void)setIndexPath:(NSIndexPath *)indexPath
{
    _indexPath = indexPath;
    
}
- (void)setAuthenticationModel:(AuthenticationModel *)authenticationModel
{
    _authenticationModel = authenticationModel;
    if (self.indexPath.row == 1) {
        [self.clickFrontBtn sd_setImageWithURL:[NSURL URLWithString:authenticationModel.idcardfront] forState:UIControlStateNormal];
    }else if (self.indexPath.row == 2) {
        [self.clickFrontBtn sd_setImageWithURL:[NSURL URLWithString:authenticationModel.idcardback] forState:UIControlStateNormal];
    }else {
         [self.clickFrontBtn sd_setImageWithURL:[NSURL URLWithString:authenticationModel.hpcardicon] forState:UIControlStateNormal];
    }
    XLog(@"self.authenticationModel.idcardfront:%@",self.authenticationModel.idcardfront);
}
- (IBAction)clickFrontBtn:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(updateImageSubCell:withBtn:withIndexPath:)]) {
        [self.delegate updateImageSubCell:self withBtn:sender withIndexPath:self.indexPath];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
